﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KInterfaces;

namespace KFormBase
{
    /// <summary>
    /// 页面跳转消息
    /// </summary>
    public class ModulePageChangedEventArgs : EventArgs
    {  
        /// <summary>
        /// 跳转目标页
        /// </summary>
        public readonly ModulePage Value;
        public ModulePageChangedEventArgs(ModulePage value)
        {
            this.Value = value;
        }
    }

    /// <summary>
    /// 模块切换消息
    /// </summary>
    public class ModuleAppSwitchedEventArgs : EventArgs
    {       
        /// <summary>
        /// 目标应用程序
        /// </summary>
        public readonly ModuleApplication Value;

        public ModuleAppSwitchedEventArgs(ModuleApplication value)
        {
            this.Value = value;
        }
    }

    /// <summary>
    /// 倒计时动作更新消息
    /// </summary>
    public class CountdownUpdatedEventArgs : EventArgs
    {
        /// <summary>
        /// 倒计时动作类型
        /// </summary>
        public readonly CountdownAction Action;

        /// <summary>
        /// 会话ID，用于判断是否是同一个会话的验证码
        /// </summary>
        public readonly string Session;

        public CountdownUpdatedEventArgs(CountdownAction action, string session)
        {
            this.Action = action;
            this.Session = session;
        }
    }

    /// <summary>
    /// 公共控件属性更新消息
    /// </summary>
    public class ControlPropertyChangedEventArgs : EventArgs
    {
        /// <summary>
        /// 控件对象
        /// </summary>
        public readonly MainControls Control;

        /// <summary>
        /// 需要更新的控件属性
        /// </summary>
        public readonly ControlPropertys Property;

        /// <summary>
        /// 对于visible, enabled
        /// </summary>
        public readonly bool Value;

        public ControlPropertyChangedEventArgs(MainControls ctl, ControlPropertys prop, bool val)
        {
            this.Control = ctl;
            this.Property = prop;
            this.Value = val;
        }
    }

}
